# @time     :2021/12/31
# @Author   :Simple
# @FileName :admin_page
from selenium.webdriver.common.by import By

from common.element import GetElement
from qyex.page.address_page.address_page import AddressPage


class AdminPage:
    """
    首页
    """
    menu_span = GetElement(id_="menu_contacts", describe="通讯录按钮", wait=True)

    def __init__(self, driver):
        self.driver = driver

    def goto_address(self):
        # 点击异常可能性：
        # 2。元素有多个，需要人工挑选中合适的元素
        # 如：a标签嵌套span标签：点击span无反应，需要点击a标签
        self.menu_span.click()
        return AddressPage(self.driver)
